﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class adminstrator_findStuResult : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void TextBox3_TextChanged(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        string condstr = "", mysql;
        if (TextBox1.Text != "")
            condstr = "sNo Like'" + TextBox1.Text + "%'";
        if (TextBox2.Text != "")
            if (condstr == "")
                condstr = "sName Like'" + TextBox2.Text + "%'";
            else
                condstr = condstr + "AND sName Like'" + TextBox2.Text + "%'";
         if (TextBox3.Text != "")
            if (condstr == "")
                condstr = "cNo Like'" + TextBox3.Text + "%'";
            else
                condstr = condstr + "AND cNo Like'" + TextBox3.Text + "%'";
         if (TextBox4.Text != "")
             if (condstr == "")
                 condstr = "cName Like'" + TextBox4.Text + "%'";
             else
                 condstr = condstr + "AND cName Like'" + TextBox4.Text + "%'";
         if (condstr == "")
             mysql = "SELECT *FROM score";
         else
             mysql = "SELECT * FROM score WHERE" + condstr;
         Response.Redirect("findStuResult.aspx?mysql="+mysql);
    }
}